#include <iostream>
#include <vector>
#include <list>
using namespace std;

int main(int argc ,char* argv[])
{
    vector<double> A(10);
    for (int i = 0; i < 10; i++)
	A[i] = i + 0.1;
    vector<double>::iterator A_iterator = A.begin();//迭代器，A可以是数组、链表等
    vector<double>::iterator A_end = A.end();
    for (;A_iterator != A_end; ++A_iterator)
	cout << *A_iterator << ", ";//*,++都重载了
    cout << "\b\b." << endl;

    list<double> B;
    for (int i = 0; i < 10; i++)
	B.push_back(i + 0.1);
    list<double>::iterator B_iterator = B.begin();
    list<double>::iterator B_end = B.end();
    for (;B_iterator != B_end; ++B_iterator)
	cout << *B_iterator << ", ";
    cout << "\b\b." << endl;

    int a = 0;
    int &b = a;//左值引用，别名，可改，不可改常量
    b = 3;
    int &&c = 1;//和众多not declare问题一样，如果不是库的问题，就需要加上-std=c++0x编译
    c = 3;
    cout << a << endl;
    cout << b << endl;
    cout << c << endl;
    return 0;
}
